<template>
    <div class="uc">
      <div class="bg hasfooter">
        <div class="userInfo clear bgw">
          <img :src="user.avatar" class="avatar fl"/>
          <div class="desc"> 
            <p class="name">{{user.nickName}}</p>
            <p class="last">剩余会员天数：{{user.last}}天</p>
            <div class="buttonGroup clear">
              <a class="button fl btn2" v-link="{name: 'userinfo'}">个人资料</a>
              <a class="button fl btn2" v-link="{name: 'pay'}">{{user.vip ? '续费VIP' : '去充值'}}</a>
            </div>
          </div>
        </div>
        <group>
          <cell text="我的课程" :link="{name: 'mylessons'}">
            <img src="../../static/svg/wodekecheng.svg?v=12" />
          </cell>
          <cell text="我的收藏" :link="{name: 'myfav'}">
            <img src="../../static/svg/shoucang.svg?v=12" />
          </cell>
        </group>
        <group>
          <cell text="提醒通知" :link="{name: 'notice'}">
            <img src="../../static/svg/tixing.svg?v=12" />
          </cell>
        </group>
        <group>
          <cell text="充值记录" :link="{name: 'payrecord'}">
            <img src="../../static/svg/chongzhi.svg?v=12" />
          </cell>
          <cell text="通用设置" :link="{name: 'settings'}">
            <img src="../../static/svg/shezhi.svg?v=12" />
          </cell>
          <cell text="意见反馈" :link="{name: 'feedback'}">
            <img src="../../static/svg/yijian.svg?v=12" />
          </cell>
        </group>
    </div>
    <vfooter></vfooter>
  </div>
</template>
<script type="text/babel">
  export default {
    name: 'index',
    components: {
      vfooter: require('../components/vfooter'),
      group: require('../components/group'),
      cell: require('../components/cell')
    },
    data () {
      return {
        user: window.user
      };
    },
    created () {
      // let that = this;
      this.$dispatch('alert.close');
    }
  };
</script>
